package com.company.service.impl;

import com.company.entity.User;
import com.company.service.BaseService;

import java.util.List;
import java.util.Scanner;

public class RaseServiceimpl implements BaseService {

    User user=new User();
    @Override
    public void execute(List list) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入账户");
        user.setUsername(sc.next());
        System.out.println("输入密码");
        user.setPassword(sc.next());
        for (;;) {
            if ( user.getPassword().length()<6){
                System.out.println("密码长度不能小于6");
                System.out.println("请从新输入");
                user.setPassword(sc.next());
            }else {
                list.add(user);

                break;
            }
        }
    }
}